From 57d8607e8e9f5c2bc452a43f008b5fd01e27c782 Mon Sep 17 00:00:00 2001 From: robertl Date: Mon, 1 Nov 2004 17:37:16 +0000 Subject: [PATCH] Let xstrdup clone null strings into empty strings. --- gpsbabel/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gpsbabel/util.c b/gpsbabel/util.c index 975b7598f..c58520ac0 100644 --- a/gpsbabel/util.c +++ b/gpsbabel/util.c @@ -121,7 +121,7 @@ XSTRDUP(const char *s, DEBUG_PARAMS ) xstrdup(const char *s) #endif { - char *o = strdup(s); + char *o = s ? strdup(s) : strdup(""); #ifdef DEBUG_MEM debug_mem_output( "strdup, %x, %x, %s, %d\n", o, s, file, line ); -- 2.30.2